using System;
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
using System.Text;

internal class w
{
	private RSACryptoServiceProvider m_a;

	public w()
	{
		this.m_a = new RSACryptoServiceProvider(1024);
	}

	public w(int A_0)
	{
		this.m_a = new RSACryptoServiceProvider(A_0);
	}

	[SpecialName]
	public string a()
	{
		return this.m_a.ToXmlString(includePrivateParameters: false);
	}

	[SpecialName]
	public void e(string A_0)
	{
		this.m_a.FromXmlString(A_0);
	}

	public void a(bool A_0, w A_1)
	{
		RSAParameters parameters = this.m_a.ExportParameters(A_0);
		A_1.m_a.ImportParameters(parameters);
	}

	public RSAParameters a(bool A_0)
	{
		return this.m_a.ExportParameters(A_0);
	}

	public void a(RSAParameters A_0)
	{
		this.m_a.ImportParameters(A_0);
	}

	[SpecialName]
	public string b()
	{
		return this.m_a.ToXmlString(includePrivateParameters: true);
	}

	[SpecialName]
	public void d(string A_0)
	{
		this.m_a.FromXmlString(A_0);
	}

	public string f(string A_0)
	{
		return Convert.ToBase64String(a(Encoding.UTF8.GetBytes(A_0)));
	}

	public byte[] a(byte[] A_0)
	{
		return this.m_a.SignData(A_0, "MD5");
	}

	public bool a(string A_0, string A_1)
	{
		return a(Encoding.UTF8.GetBytes(A_0), Convert.FromBase64String(A_1));
	}

	public bool a(byte[] A_0, byte[] A_1)
	{
		return this.m_a.VerifyData(A_0, "MD5", A_1);
	}

	public string c(string A_0)
	{
		return Convert.ToBase64String(b(Encoding.UTF8.GetBytes(A_0)));
	}

	public string b(string A_0)
	{
		return Encoding.UTF8.GetString(c(Convert.FromBase64String(A_0)));
	}

	public byte[] b(byte[] A_0)
	{
		return this.m_a.Encrypt(A_0, fOAEP: false);
	}

	public byte[] c(byte[] A_0)
	{
		return this.m_a.Decrypt(A_0, fOAEP: false);
	}

	public string b(bool A_0)
	{
		RSAParameters rSAParameters = this.m_a.ExportParameters(A_0);
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.Append((rSAParameters.D != null) ? Convert.ToBase64String(rSAParameters.D) : "").Append("\n");
		stringBuilder.Append((rSAParameters.DP != null) ? Convert.ToBase64String(rSAParameters.DP) : "").Append("\n");
		stringBuilder.Append((rSAParameters.DQ != null) ? Convert.ToBase64String(rSAParameters.DQ) : "").Append("\n");
		stringBuilder.Append((rSAParameters.Exponent != null) ? Convert.ToBase64String(rSAParameters.Exponent) : "").Append("\n");
		stringBuilder.Append((rSAParameters.InverseQ != null) ? Convert.ToBase64String(rSAParameters.InverseQ) : "").Append("\n");
		stringBuilder.Append((rSAParameters.Modulus != null) ? Convert.ToBase64String(rSAParameters.Modulus) : "").Append("\n");
		stringBuilder.Append((rSAParameters.P != null) ? Convert.ToBase64String(rSAParameters.P) : "").Append("\n");
		stringBuilder.Append((rSAParameters.Q != null) ? Convert.ToBase64String(rSAParameters.Q) : "").Append("\n");
		return stringBuilder.ToString();
	}

	public void a(string A_0)
	{
		RSAParameters parameters = default(RSAParameters);
		string[] array = A_0.Split('\n');
		parameters.D = (string.IsNullOrEmpty(array[0]) ? null : Convert.FromBase64String(array[0]));
		parameters.DP = (string.IsNullOrEmpty(array[1]) ? null : Convert.FromBase64String(array[1]));
		parameters.DQ = (string.IsNullOrEmpty(array[2]) ? null : Convert.FromBase64String(array[2]));
		parameters.Exponent = (string.IsNullOrEmpty(array[3]) ? null : Convert.FromBase64String(array[3]));
		parameters.Modulus = (string.IsNullOrEmpty(array[4]) ? null : Convert.FromBase64String(array[4]));
		parameters.Modulus = (string.IsNullOrEmpty(array[5]) ? null : Convert.FromBase64String(array[5]));
		parameters.P = (string.IsNullOrEmpty(array[6]) ? null : Convert.FromBase64String(array[6]));
		parameters.Q = (string.IsNullOrEmpty(array[7]) ? null : Convert.FromBase64String(array[7]));
		this.m_a.ImportParameters(parameters);
	}
}
